@ECHO OFF

SET MAIN=com.trydofor.id.xnet.GuiShell
SET EXLD=lib\client-lib-exclude.txt

CD /D %~DP0
SETLOCAL ENABLEDELAYEDEXPANSION
SETLOCAL ENABLEEXTENSIONS

REM set class path
SET CP=cnf;ext
FOR %%I IN (a9id-net-*.jar) DO SET CP=!CP!;%%I
FOR %%I IN (lib\*.jar) DO (
    SET INC=YES
    IF EXIST %EXLD% (
        FOR /F %%J IN (%EXLD%) DO (
            ECHO "%%I" | FIND "%%J" > NUL
            IF !ERRORLEVEL! == 0 SET INC=NO
        )
    )
    IF "!INC!" == "YES" SET CP=!CP!;%%I
)
FOR %%I IN (ext\*.jar) DO (
    SET CP=!CP!;%%I
)

START javaw %A9ID_OPTS% -classpath %CP% %MAIN% %*
ENDLOCAL
